package com.brewdroid.model;

import com.brewdroid.enumerators.FlocLevel;
import com.brewdroid.enumerators.YeastFormat;

public class Yeast implements Ingredient{
	private IngredientImpl ingredient;
	private YeastFormat format;
	private float optimumTemp;
	private FlocLevel flocculation;
	private int lowAttenuation;
	private int highAttenuation;
	
	public Yeast(String name, String description){
		ingredient = new IngredientImpl(name, description);
	}
	
	public Yeast()
	{
		ingredient = new IngredientImpl();
	}
	
	public YeastFormat getFormat() {
		return format;
	}
	public void setFormat(YeastFormat format) {
		this.format = format;
	}
	public float getOptimumTemp() {
		return optimumTemp;
	}
	public void setOptimumTemp(float optimumTemp) {
		this.optimumTemp = optimumTemp;
	}
	public FlocLevel getFlocculation() {
		return flocculation;
	}
	public void setFlocculation(FlocLevel flocculation) {
		this.flocculation = flocculation;
	}
	public int getLowAttenuation() {
		return lowAttenuation;
	}
	public void setLowAttenuation(int lowAttenuation) {
		this.lowAttenuation = lowAttenuation;
	}
	public int getHighAttenuation() {
		return highAttenuation;
	}
	public void setHighAttenuation(int highAttenuation) {
		this.highAttenuation = highAttenuation;
	}
	@Override
	public String getName() {
		return ingredient.getName();
	}
	@Override
	public String getDescription() {
		return ingredient.getDescription();
	}

	@Override
	public void setName(String name) {
		ingredient.setName(name);
		
	}

	@Override
	public void setDescription(String description) {
		ingredient.setDescription(description);
	}
	
	@Override
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		sb.append("Name: "+ingredient.getName()+"\n");
		sb.append("Description: "+ingredient.getDescription() + "\n");
		sb.append("Format: "+format.toString()+"\n");
		sb.append("OptimumTemperature: "+Float.toString(optimumTemp)+"\n");
		sb.append("Flocculation Level: "+flocculation.toString()+"\n");
		sb.append("Low Attenuation: "+Integer.toString(lowAttenuation)+"\n");
		sb.append("High Attenuation: "+ Integer.toString(highAttenuation)+ "\n");
		
		return sb.toString();
	}
}
